#include <stdio.h>  
#include <stdlib.h>  
#include <getopt.h>  


int main(int argc, char *argv[])  
{  
    int optc;  


    printf("argc: %d, argv: ", argc);
    for (int i = 0; i < argc; i++) {  
        printf("%s ", argv[i]);  
    }  
    printf("\n");

    while ((optc = getopt(argc, argv, "ab:c:de::")) != -1) {  
        //print(optc, argc, argv, optind);  
        switch (optc) {  
            case 'a':
                printf("a\n");
                break;
            case 'b':
                printf("b: %s\n", optarg);
                break;
            case 'c':
                printf("c: %s\n", optarg);
                break;
            case 'd':
                printf("d: %s\n", optarg);
                break;
            case 'e':
                printf("e: %s\n", optarg);
                break;
            default:  
                break;  
        }  
    }  

    //print('0', argc, argv, optind);  
    return 0;
}
